package org.leon.factory;

import org.leon.DefaultSqlSession;
import org.leon.Executor;
import org.leon.SqlSession;
import org.leon.pojo.Configuration;

/**
 * Created by leon.L on 2019/12/25.
 * Desc :
 */
public class DefaultSqlSessionFactory implements SqlSessionFactory {

    private Configuration configuration;
    private Executor executor;

    public DefaultSqlSessionFactory(Configuration configuration, Executor executor) {
        this.configuration = configuration;
        this.executor = executor;
    }

    @Override
    public SqlSession openSession() {
        return new DefaultSqlSession(configuration, executor);
    }
}
